public class MyBinaryTree {
    static class TreeNode{
        int val;
        TreeNode left;
        TreeNode right;
        public TreeNode(int val){
            this.val=val;
        }
    }

    public TreeNode root;

    public void preOrder(TreeNode root) {
        if(root == null){
            return;
        }
        System.out.print(root.val+" ");
        preOrder(root.left);
        preOrder(root.right);
    }

    public void inOrder(TreeNode root) {
        if(root == null){
            return;
        }
        preOrder(root.left);
        System.out.print(root.val+" ");
        preOrder(root.right);
    }

    public void postOrder(TreeNode root) {
        if(root == null){
            return;
        }
        preOrder(root.left);
        preOrder(root.right);
        System.out.print(root.val+" ");
    }
    public int size1(TreeNode root) {
        if(root == null){
            return 0;
        }
        return size1(root.left)+size1(root.right)+1;
    }
    public int treeSize;
    public void size2(TreeNode root) {
        if(root == null){
            return;
        }
        treeSize += 1;
        size2(root.left);
        size2(root.right);
    }
    public int getLeafNodeCount(TreeNode root) {
        if(root == null){
            return 0;
        }
        if(root.left == null && root.right == null){
            return 1;
        }
        int leftlift = getLeafNodeCount(root.left);
        int rightlift = getLeafNodeCount(root.right);
        return leftlift+rightlift;
    }
    public int getKLevelNodeCount(TreeNode root,int k) {
        if(root == null){
            return 0;
        }
        if(k == 1){
            return 1;
        }
        int leftSize = getKLevelNodeCount(root.left,k-1);
        int rightSize = getKLevelNodeCount(root.left,k-1);
        return leftSize+rightSize;
    }
    public int getHeight(TreeNode root) {
        if(root == null){
            return 0;
        }
        int leftHight =  getHeight(root.left);
        int rightHight = getHeight(root.right);
        return (leftHight>rightHight)?(leftHight+1):(rightHight +1);
    }
    public int maxDepth(TreeNode root) {
        if(root == null){
            return 0;
        }
        int leftHight =  maxDepth(root.left);
        int rightHight = maxDepth(root.right);
        return (leftHight>rightHight)?(leftHight + 1):(rightHight +1);
    }
    public TreeNode find(TreeNode root, int val) {

    }
    public void levelOrder(TreeNode root) {

    }
    public boolean isCompleteTree(TreeNode root) {

    }
}
